package com.jt.www.domain.enums.pc;

/**
 * 行管 行政级别: 1-省级;2-市级;3-区级
 * Created by shaoyn on 2020/12/24.
 */
public enum AdminLevelEnum {
    PROVINCE((byte) 1, "省级"),
    CITY((byte) 2, "市级"),
    COUNTY((byte) 3, "区级");
    /**
     * 级别
     */
    private Byte level;
    /**
     * 描述
     */
    private String desc;

    AdminLevelEnum(Byte level, String desc) {
        this.level = level;
        this.desc = desc;
    }

    public static String getDescByLevel(Byte level) {
        if (null == level) {
            return "";
        }
        for (AdminLevelEnum adminLevelEnum : AdminLevelEnum.values()) {
            if (adminLevelEnum.level == level) {
                return adminLevelEnum.desc;
            }
        }
        return "";
    }
}
